<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>初识vue</title>
    <script src="/js/vue-2.7.9-dev.js"></script>
</head>
<body>
    <div id="app">
        <!-- vue 模板字符串 -->
        {{msg}}

        <div id="div2">
            我是div2 {{msg}}
        </div>
        <button v-on:click="click2">按钮</button>
    </div>

    <script>
        let vm = new Vue({
        // el 值是选择器, 将对应的原则使用vue管理
            el:"#app",
            data:{
                msg:"hello 晋中理工"
            },
            methods: {
                click2(){
                    setTimeout(() => {
                        this.msg = "山西晋中理工学院"
                    }, 2000)
                }
            },
        })
        console.log(vm);
        console.log("===", vm.msg);
    </script>
</body>
</html>